﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace HyperPin_Database_Editor
{
    public partial class HPIntroVideoSettings : HPSettingsPanel
    {
        static string iniUseIntro = "Use_Intro";
        static string iniSkipOnKeypress = "Skip_On_Keypress";

        // hardcoded as this is not a configurable parameter of HyperPin
        static string introVideoFileName = "Media\\HyperPin\\Intro.f4v";

        public HPIntroVideoSettings()
        {
            InitializeComponent();

            textIntroVideoFileName.Text = Path.Combine(MainForm.theMainForm.hyperPinDirectory, introVideoFileName);
            updateOptionalControls();
        }

        public void updateOptionalControls()
        {
            checkSkipOnKeypress.Enabled = checkUseIntroVideo.Checked;
        }

        public override void doLoadSettings()
        {
            checkUseIntroVideo.Checked = readSettingBool(iniUseIntro, false);
            checkSkipOnKeypress.Checked = readSettingBool(iniSkipOnKeypress, false);
        }

        public override void doSaveSettings()
        {
            writeSettingBool(iniUseIntro, checkUseIntroVideo.Checked);
            writeSettingBool(iniSkipOnKeypress, checkSkipOnKeypress.Checked);
        }

        private void checkUseIntroVideo_CheckedChanged(object sender, EventArgs e)
        {
            updateOptionalControls();
        }
    }
}
